/* 
* @Author: Jerry-chen
* @Date:   2014-07-10 02:11:47
* @Last Modified by:   Jerry-chen
* @Last Modified time: 2014-07-12 20:47:00
*/
/* 
* @Author: Jerry-chen
* @Date:   2014-07-10 02:08:04
* @Last Modified by:   Jerry-chen
* @Last Modified time: 2014-07-10 02:08:37
*/
// 获得座位的序号
$(function(){
	$('#seatname').live('change',function() {
		// 清除HTML，防止多次添加
		$('.seatsort').empty();
		//获得SEATID
		 var seatid = $(this).val();

		 	$.ajax({
                        url: APP + '&c=Goods&m=ajax_select_seatsort',
                        type: 'post',
                        dataType: 'json',
                        data: {'seatid' : seatid},
                        success:function(seatsortdata){
                        		
                            //定义座位字符串
                            var seatsortum="";
                            //循环返回的数据
                            seatsortum+="<tr><th>时间</th><td><input type='text' value='时间' readonly='readonly' class='seatTime' name='time1' /></td></tr>"
                           seatsortum +="<tr><th width='120' class='w100'>座位=》</th><td id='sortsytle'>";
                            $.each(seatsortdata, function(k, v) {
                            	if(v==0){
                        		  seatsortum +="<p style='color:red;'>没有可选的座位，请先添加</p>";
                            	}else{
                            		 //循环组合属性
                              seatsortum +="<div class='seatwidth'><p>"+v+"</p> <p><input type='text' class='50' value='价格' class='setprice' name='price1[]' /></p><input type='hidden' name='seatname[]' value='"+v+"' />\
                                   <script>\
                                    $('.seatTime').calendar({format: 'yyyy/MM/dd HH:mm:ss'});\
                                 </script>\
                                 </div>";
                            	}
                            });
                            seatsortum +="</td></tr>";
                            $('.seatsort').append(seatsortum);          
                        }
               })

		});






})
